package com.xy.job.admin.core.schedule

class ScheduleTask(
    /**
     * 延迟时间ms
     */
    delay: Long = 0L,
    /**
     * 任务名称
     */
    private val name: String,
    /**
     * 任务
     */
    private val task: Runnable,
) : Runnable by task {
    /**
     * 过期时间
     */
    val expiration: Long = System.currentTimeMillis() + delay

    /**
     * 时间槽
     */
    var scheduleTaskList: ScheduleTaskList? = null

    override fun toString(): String {
        return "ScheduleTask(name='$name')"
    }
}